package com.ysxsoft.wdg.util;

import android.webkit.JavascriptInterface;

import com.ysxsoft.wdg.util.sp.SharePrefUtils;


public class JavaInterface {
    @JavascriptInterface
    public String getUserId() {
        return SharePrefUtils.getUserId();
    }

    @JavascriptInterface
    public void share(String url) {
        ObserverMap.notify("THuiWebFragment", "gid", url);
    }

    @JavascriptInterface
    public void share2(String id, String url) {
        ObserverMap.notify2("KanWebViewActivity", "gid", url);
    }

    @JavascriptInterface
    public void shareByDetail(String url) {
        ObserverMap.notify("KanWebViewActivity", "gid", url);
    }

    @JavascriptInterface
    public void pay(String orderId, String money, int type, String url) {
        ObserverMap.pay("THuiWebFragment", orderId, money, type, url);
    }

    @JavascriptInterface
    public void back() {
        ObserverMap.back("KanWebViewActivity");
    }

    @JavascriptInterface
    public void goToProductDetail(String productId){
        ObserverMap.toProductDetail("TTaoWebFragment",productId);
    }

    @JavascriptInterface
    public void toPinOrderDetail(String id) {
        ObserverMap.toKanOrderDetail("KanWebViewActivity", id);
    }

    @JavascriptInterface
    public void toKanOrderDetail(String id) {
        ObserverMap.notify("KanWebViewActivity", "gid", id);
    }
}
